package main

import (
	"fmt"
	"strings"
)

func main() {
	str := "The quick brown fox jumps over the lazy dog"
	s1 := strings.Fields(str) //分割字符串，默认空格
	fmt.Printf("%v\n", s1)
	for _, val := range s1 {
		fmt.Printf("%s -", val)
	}
	fmt.Println()
	str2 := "GO1| THE ABC of Go|25"
	s12 := strings.Split(str2, "|") //分割字符串，自定义规则分割
	fmt.Printf("%v\n", s12)
	for _, val := range s12 {
		fmt.Printf("%s -", val)
	}
	fmt.Println()
	str3 := strings.Join(s12, ";") //合并字符串,用;号
	连接
	fmt.Printf("%s\n", str3)
}
